<?php
namespace Home\Controller;
use Think\Controller;

/**
 * Class SimulateController
 * @package Home\Controller
 *
 * Author: 黄盖
 * Date: 2017-12-18 9:12
 * Info: 调试入口
 */
class SimulateController extends Controller
{

    /**
     * Function entry
     *
     * Author: 黄盖
     * Date: 2017-15-18 9:15
     * Info: 入口
     */
    public function entry()
    {
        $server_class = I('get.server_class');
        $server_function = I('get.server_function');

        if( empty( $server_class ) || empty( $server_function ) )
        {
            echo 'server_class, server_function 参数错误!';
            exit;
        }

        $New_className = "\\Home\\Server\\{$server_class}";

        $Afferent = Array();

        foreach( $_POST as $key => $val )
        {
            $Afferent[] = Array( 'name' => $val );
        }

        $outputData = ( new $New_className ) ->$server_function( $Afferent[0]['name'], $Afferent[1]['name'], $Afferent[2]['name'], $Afferent[3]['name'], $Afferent[4]['name'], $Afferent[5]['name'] );

        echo $outputData;
        var_dump( $outputData );
    }
}
?>